Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add process posture check #1693

Merged
merged 30 commits into from
Jun 10, 2024
Merged

Add process posture check #1693

merged 30 commits into from
Jun 10, 2024

Conversation

bcmmbaga
Copy link
Contributor

@bcmmbaga bcmmbaga commented Mar 12, 2024

Describe your changes

Introduces a process posture check to validate the existence and active status of specific binaries on peer systems. The check ensures that files are present at specified paths, and that corresponding processes are running. This check supports Linux, Windows, and macOS systems.

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@bcmmbaga bcmmbaga marked this pull request as ready for review March 13, 2024 09:18
@bcmmbaga bcmmbaga requested a review from lixmal March 13, 2024 10:19
* Add posture checks validation

* Refactor code to incorporate posture checks validation directly into management.

* Add posture checks validation for geolocation, OS version, network, process, and NB-version

* Fix tests
lixmal
lixmal previously approved these changes Mar 15, 2024
@mlsmaycon mlsmaycon requested a review from lixmal March 15, 2024 09:23
mlsmaycon
mlsmaycon previously approved these changes Mar 15, 2024
@mlsmaycon mlsmaycon self-requested a review March 15, 2024 14:56
@bcmmbaga bcmmbaga marked this pull request as draft March 15, 2024 15:10
@bcmmbaga bcmmbaga marked this pull request as ready for review April 10, 2024 09:28
pappz
pappz previously approved these changes Apr 15, 2024
* Add method to retrieve peer's applied posture checks

* Add posture checks in server response and update proto messages

* Refactor

* Extends peer metadata synchronization through SyncRequest and propagate posture changes on syncResponse

* Remove account lock

* Pass system info on sync

* Fix tests

* Refactor

* resolve merge

* Evaluate process check on client (#1749)

* implement  server and client sync peer meta alongside mocks

* wip: add check file and process

* Add files to peer metadata for process check

* wip: update peer meta on first sync

* Add files to peer's metadata

* Evaluate process check using files from peer metadata

* Fix panic and append windows path to files

* Fix check network address and files equality

* Evaluate active process on darwin

* Evaluate active process on linux

* Skip processing processes if no paths are set

* Return network map on peer meta-sync and update account peer's

* Update client network map on meta sync

* Get system info with applied checks

* Add windows package

* Remove a network map from sync meta-response

* Update checks proto message

* Keep client checks state and sync meta on checks change

* Evaluate a running process

* skip build for android and ios

* skip check file and process for android and ios

* bump gopsutil version

* fix tests

* move process check to separate os file

* refactor

* evaluate info with checks on receiving management events

* skip meta-update for an old client with no meta-sync support

* Check if peer meta is empty without reflection
@bcmmbaga bcmmbaga dismissed stale reviews from pappz and lixmal via c6ab215 April 15, 2024 13:00
@mlsmaycon mlsmaycon mentioned this pull request Apr 27, 2024
@mlsmaycon mlsmaycon changed the base branch from main to 0.28.0 May 23, 2024 18:35
pascal-fischer and others added 5 commits May 31, 2024 17:30
* Fix posture check sonar lint errors

* Refactor error handling and streamline connection process in grpc client

* Refactor GRPC server code for improved readability

* Refactoring

* Remove duplicate GetPeerAppliedPostureChecks method
# Conflicts:
#	management/proto/management.pb.go
Copy link

sonarcloud bot commented Jun 6, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
9 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.5% Duplication on New Code

See analysis details on SonarCloud

@bcmmbaga bcmmbaga merged commit 01ec3a9 into 0.28.0 Jun 10, 2024
24 checks passed
@bcmmbaga bcmmbaga deleted the add-process-posture-check branch June 10, 2024 09:18
mlsmaycon added a commit that referenced this pull request Jun 13, 2024
* compile client under freebsd (#1620)

Compile netbird client under freebsd and now support netstack and userspace modes.
Refactoring linux specific code to share same code with FreeBSD, move to *_unix.go files.

Not implemented yet:

Kernel mode not supported
DNS probably does not work yet
Routing also probably does not work yet
SSH support did not tested yet
Lack of test environment for freebsd (dedicated VM for github runners under FreeBSD required)
Lack of tests for freebsd specific code
info reporting need to review and also implement, for example OS reported as GENERIC instead of FreeBSD (lack of FreeBSD icon in management interface)
Lack of proper client setup under FreeBSD
Lack of FreeBSD port/package

* Add DNS routes (#1943)

Given domains are resolved periodically and resolved IPs are replaced with the new ones. Unless the flag keep_route is set to true, then only new ones are added.
This option is helpful if there are long-running connections that might still point to old IP addresses from changed DNS records.

* Add process posture check (#1693)

Introduces a process posture check to validate the existence and active status of specific binaries on peer systems. The check ensures that files are present at specified paths, and that corresponding processes are running. This check supports Linux, Windows, and macOS systems.


Co-authored-by: Evgenii <mail@skillcoder.com>
Co-authored-by: Pascal Fischer <pascal@netbird.io>
Co-authored-by: Zoltan Papp <zoltan.pmail@gmail.com>
Co-authored-by: Viktor Liu <17948409+lixmal@users.noreply.github.com>
Co-authored-by: Bethuel Mmbaga <bethuelmbaga12@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants